package com.bzkj.basicinfo.mapper;

import cn.hutool.core.date.DateTime;
import com.bzkj.basicinfo.domain.ncc.TableXXXSku;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * @author wl
 * @description 针对表【table_1001ZZ100000000FAUD9_sku】的数据库操作Mapper
 * @createDate 2024-12-23 09:12:49
 * @Entity com.bzkj.basicinfo.domain.ncc.Table1001zz100000000faud9Sku
 */
public interface TableXXXSkuMapper
{

    /**
     * 判断指定的表是否存在
     *
     * @param tableName
     * @return
     */
    boolean isTableExist(@Param("tableName") String tableName);

    /**
     * 批量新增数据
     * @param xxxSkus
     * @return
     */
    int batchInsertData(@Param("xxxSkus") List<TableXXXSku> xxxSkus,@Param("tableName") String tableName);

    List<HashMap<String,Object>> findTableXXXSkuList(@Param("dto") TableXXXSku entity, @Param("tableName") String tableName);

    void updateXXXSkuMapper(@Param("item") String item, @Param("i") int i, @Param("tableName") String tableName);

    void updateXXXSkuMapperAll(@Param("tableName") String tableName, @Param("pkBatchcode") String pkBatchcode, @Param("i") int i);

    List<TableXXXSku> findTableXXXSkuListByBatchCode(@Param("tableName") String tableName, @Param("pkBatchcode") String pkBatchcode,@Param("row") String row);

    List<TableXXXSku> findTableXXXSkuListByBatchCode1(@Param("tableName") String tableName, @Param("pkBatchcode") String pkBatchcode);

    List<TableXXXSku> findListData(@Param("tableName") String tableName, @Param("vbillcode") String vbillcode, @Param("batchCode") String batchCode,@Param("row")String row);
    List<TableXXXSku> findListDataByVbatchCode(@Param("tableName") String tableName, @Param("vbatchcode") String vbatchcode);

    void updateEnable(@Param("batchId") List<String> batchId, @Param("tableName") String tableName,@Param("pkBatchcode") String pkBatchcode);

    void deleteXXXSkuByIdList(@Param("tableName") String tableName,@Param("ids")List<Integer> ids);

    void updateXXXSkuPrintFlag(@Param("ids")List<Integer> ids,@Param("tableName") String tableName,@Param("printFlag")Integer printFlag);

    List<TableXXXSku> findAllByIdOrParentIds(@Param("parentIds")List<Integer> parentIds,@Param("tableName") String tableName);

    List<TableXXXSku> findAllBySkuParentId(@Param("parentId")String parentId,@Param("tableName") String tableName);

    /**
     * 获取大码数据
     * @param parentIds
     * @param tableName
     * @param vbillcode
     * @return
     */
    List<TableXXXSku> findAllBySkuParentIds(@Param("parentIds")List<String> parentIds,@Param("tableName") String tableName,@Param("vbillcode") String vbillcode);

    /**
     * 期初打印获取大码数据
     * @param parentIds
     * @param tableName
     * @param vbillcode
     * @return
     */
    List<TableXXXSku> findAllQcBySkuParentIds(@Param("parentIds")List<String> parentIds,@Param("tableName") String tableName,@Param("vbillcode") String vbillcode);

    List<TableXXXSku> findInfoBySortNum(@Param("tableName") String tableName,@Param("vbillcode")String vbillcode,@Param("startSortNum")Integer startSortNum,@Param("endSortNum")Integer endSortNum,@Param("packageRatio")String packageRatio);

    void deleteTableData(@Param("tableName") String tableName, @Param("vbillcode") String vbillcode, @Param("vbatchcode") String vbatchcode,@Param("row") String row);

    /**
     * 管理员清空标签
     *
     * @param tableName
     * @param vbatchcode
     */
    void deleteTableDataByVbatchCode(@Param("tableName") String tableName, @Param("vbatchcode") String vbatchcode);

    //期初打印清空
    void deleteBeforeTableData(@Param("tableName") String tableName, @Param("vbillcode") String vbillcode, @Param("vbatchcode") String vbatchcode, @Param("row") String row);
    //期初打印补打
    List<TableXXXSku> findBeforeInfoBySortNum(@Param("tableName") String tableName,@Param("vbillcode")String vbillcode,@Param("startSortNum")Integer startSortNum,@Param("endSortNum")Integer endSortNum,@Param("packageRatio")String packageRatio,@Param("skuParentId")String skuParentId);
    List<TableXXXSku> findBeforeInfoBySortNum1(@Param("tableName") String tableName,@Param("vbillcode")String vbillcode,@Param("startSortNum")String startSortNum,@Param("packageRatio")String packageRatio,@Param("skuParentId")String skuParentId);

    //获取期初打印的数据
    List<TableXXXSku> findBeforeListData(@Param("tableName") String tableName, @Param("vbillcode") String vbillcode, @Param("batchCode") String batchCode,@Param("row")String row);

    /**
     * 根据批号修改复验期和效期
     * @param tableName
     * @param vbatchCode
     */
    void updateRestAndExpByVbatchCode(@Param("tableName") String tableName, @Param("vbatchCode") String vbatchCode, @Param("expDate")DateTime expDate, @Param("resetDate")DateTime resetDate);
}




